import Vue from 'vue'
import VueRouter from 'vue-router'

Vue.use(VueRouter)

const routes = [
  {
    path: '/index',
    name: 'Index',
    component: () => import( '../views/Index.vue')
  },
  {
    path: '/detail',
    name: 'Detail',
    component: () => import( '../views/Detail.vue')
  },
  {
    // 组件路径
    path:"/my",
    name:"My",
    component:()=>import('../views/My.vue'),
  },
  {
    // 组件路径
    path:"/comments",
    name:"Comments",
    component:()=>import('../views/Comments.vue'),
  },
  {
    // 组件路径
    path:"/login",
    name:"Login",
    component:()=>import('../views/Login.vue'),
  },
  {
    // 组件路径
    path:"/private",
    name:"Private",
    component:()=>import('../views/Private.vue'),
  },
  {
    // 组件路径
    path:"/setting",
    name:"Setting",
    component:()=>import('../views/Setting.vue'),
  },
  {
    // 组件路径
    path:"/account",
    name:"Account",
    component:()=>import('../views/Account.vue'),
  },
  // 路由重定向
  {
    path:"*",
    redirect:{
      name:"Index"
    }
  }
]

const router = new VueRouter({
  routes
})



export default router
